<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit">
<title>铁水联运信息核查系统--补贴申报</title>
	<link rel="shortcut icon" href="${mainDomain}/statics/images/favicon.ico">
    <link rel="stylesheet" href="${mainDomain}/statics/css/front/amazeui.min.css"/>
  	<link rel="stylesheet" href="${mainDomain}/statics/css/front/admin.css">
    <link rel="stylesheet" media="screen" href="${mainDomain}/statics/css/front/bootstrap.min.css" >
    <link rel="stylesheet" media="screen" href="${mainDomain}/statics/css/front/bootstrap-datetimepicker.min.css" >
    <script type="text/javascript">
        var mainDomain = "${mainDomain}";
		var miscDomain = '${mainDomain}';
    </script>
</head>
<body>
<#include "common/memberheader.ftl" />
<div class="am-cf admin-main">
	<#include "common/memberleft.ftl" />
	<!-- content start -->
<div class="admin-content">
    <div class="admin-content-body">
        <div class="am-cf am-padding am-padding-bottom-0">
            <div class="am-fl am-cf">
                <strong class="am-text-primary am-text-lg">补贴申报</strong>
            </div>
        </div>
		<a href="/btsb/export/xlhdExcelView" target="_self" style="padding-left: 20px;">--箱量核对信息表模板下载--</a> 
        <hr>


        <form id="my-form" class="am-form" action="javascript:;" method="post" data-am-validator>
        	<input type="hidden" id="nfhidden" value="${dqnf}"/>
        	<input type="hidden" id="jdhidden" value="${dqjd}"/>
        	<input type="hidden" id="jzsjhidden" value="${sbsj}"/>
			<div class="am-g">
                <div class="am-u-sm-4 am-u-md-2 am-text-right">
                    企业名称
                </div>
                <div class="am-u-sm-8 am-u-md-4 am-form-group am-u-end">
                    <input type="text" id="qyqc" name="qyqc" value="${(yhxxModel.qyqc)!''}" maxlength="30" class="am-input-sm" placeholder="请输入企业名称" data-validation-message="请输入企业名称"  readonly/>
                </div>
            </div>
            
            <!--<div class="am-g am-margin-top">
                <div class="am-u-sm-4 am-u-md-2 am-text-right">
                    填报日期
                </div>
                <div class="am-u-sm-8 am-u-md-4">
                    <div class="am-form-group am-form-icon">
                        <input id="tbsj" name="tbsj" type="text" value="${(yhxxModel.tbsj)!''}" class="am-input-sm" readonly/>
                    </div>
                </div>
                <div class="am-u-sm-12 am-u-md-6 am-text-danger">＊ 必填</div>
            </div>-->
            
            <div class="am-g am-margin-top">
                <div class="am-u-sm-4 am-u-md-2 am-text-right">
                    申报季度
                </div>
                <div class="am-u-sm-8 am-u-md-4 am-form-group am-u-end">
                    <input type="text" id="sbjd" name="sbjd" value="${dqnf}年-第${dqjd}季度" maxlength="30" class="am-input-sm" readonly/>
                </div>
            </div>
            
            <div class="am-g am-margin-top">
                <div class="am-u-sm-4 am-u-md-2 am-text-right">
                   上传箱量核对信息表
                </div>
                <div class="am-u-sm-8 am-u-md-4 am-form-group">
                    <div id="showuplaod" class="am-g">	
		                <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
		                    <div class="am-form-file" style="width:105px">
							  <button type="button" class="am-btn am-btn-danger am-btn-sm">
								<i class="am-icon-cloud-upload"></i> 选择文件</button>
							  <input id="hdxxfile" name="hdxxfile" type="file">
							</div>
		                </div>
						<div id="hdxxfile-list"></div>
					</div>
                </div>
                <div class="am-u-sm-12 am-u-md-6 am-text-danger" id="hdxx_tips">＊ 必填</div>
            </div>
            
            <div class="am-g am-margin-top">
            	<span id="jzrq" style="font-weight:bold;color:red;">${dqnf}年第${dqjd}季度申报截至时间为${sbsj}</span>
            </div>

            <div class="am-margin">
                <button type="submit" data-am-modal="{target: '#my-modal-loading'}" id="saveButton" class="am-btn am-btn-primary am-btn-xs">提交保存</button>
            </div>
        </form>
		
		<p class="MsoListParagraph" style="margin-bottom:0;margin-bottom:0;line-height:23px">
		<span style="font-size:20px;font-family:仿宋;font-weight: bold;color: red;">申报注意事项</span>
		<p class="MsoListParagraph" style="margin-bottom:0;margin-bottom:0;text-indent:27px;line-height:23px">
		<span style="font-size:17px;font-family:仿宋;color: red;">1.线上填报后还需准备相应纸质材料交至航交所</span>
		<p class="MsoListParagraph" style="margin-bottom:0;margin-bottom:0;text-indent:27px;line-height:23px">
		<span style="font-size:17px;font-family:仿宋;color: red;">2.铁路货票和水路运单图片可以通过线上或线下(推荐使用U盘)传输给补贴受理人员</span>
		<p class="MsoListParagraph" style="margin-bottom:0;margin-bottom:0;text-indent:27px;line-height:23px">
		<span style="font-size:17px;font-family:仿宋;color: red;">3.如果是外贸箱，请填写海关申报单号和海关照片名称</span>
		<p class="MsoListParagraph" style="margin-bottom:0;margin-bottom:0;text-indent:27px;line-height:23px">
		<span style="font-size:17px;font-family:仿宋;color: red;">4.照片名称填写项请与实际名称一致</span>
		<p class="MsoListParagraph" style="margin-bottom:0;margin-bottom:0;text-indent:27px;line-height:23px">
		<span style="font-size:17px;font-family:仿宋;color: red;">5.上传完后下载证明单并找相关部门盖章后，纸质交于补贴受理人员</span>
		<p class="MsoListParagraph" style="margin-bottom:0;margin-bottom:0;text-indent:27px;line-height:23px">
		<span style="font-size:17px;font-family:仿宋;color: red;">6.请确保以上材料齐全便于审核</span>
    </div>
</div>
</div>
</div>

<div class="am-modal am-modal-loading am-modal-no-btn" tabindex="-1" id="my-modal-loading">
  <div class="am-modal-dialog">
    <div class="am-modal-hd">正在导入...</div>
    <div class="am-modal-bd">
      <span class="am-icon-spinner am-icon-spin"></span>
    </div>
  </div>
</div>

<a href="#" class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu"
   data-am-offcanvas="{target: '#admin-offcanvas'}"></a>
<#include "common/memberfooter.ftl" />
</div>
	<script type="text/javascript" src="${mainDomain}/statics/js/front/jquery-1.9.1.min.js"></script>
	<script type="text/javascript" src="${mainDomain}/statics/js/front/amazeui.min.js"></script>
	<script type="text/javascript" src="${mainDomain}/statics/js/front/ajaxfileupload.js"></script>
	
	<script>
	$('#my-form').validator(
    {
        validate: function (validity) {
        	
            if ($(validity.field).is('#hdxxfile')) {
			    var fileName=$("#hdxxfile").val();
				if(fileName==""){
					validity.valid = false;
					$('#hdxx_tips').html("箱量核对信息表必填");
				}else{
			    	validity.valid = true;
                    $('#hdxx_tips').html("");
			    }
        	}
        },
        
        submit: function() {
        	if(this.isFormValid()){
        	if(confirm("您是否已了解申报注意事项？")){
        		var sbjd = $('#jdhidden').val();
        	var sbnf = $('#nfhidden').val();
        	var sbsj = $('#jzsjhidden').val();
        	var myDate = new Date();
        	//获取当前年
	        	var year=myDate.getFullYear();
			//获取当前月
		        var month=myDate.getMonth()+1;
			//获取当前日
		        var date=myDate.getDate();
		    var now = year+'-'+addzero(month)+"-"+addzero(date);
		    var result = compareDate(now,sbsj);
		    if(result>0){
		    	alert('已超过申报截止日期!');
		    	location.reload();
		    	return;
		    }
        	
        	$.ajaxFileUpload({
				url:'/btsb/addhzandmx?sbjd='+sbjd+'&sbnf='+sbnf,
				secureuri:false,
				fileElementId:'hdxxfile',
				dataType:'text',
				success:function(data){
					if(data!=null){
						var status = data.substring(data.indexOf("message")+10,data.indexOf('"}'));
						if(status=="Y"){
							alert("保存成功");
							$('#my-modal-loading').hide();
							window.location.href="/btsb/onehzlistindex";
						}
						else{
							alert(status);
							location.reload();
						}
					}
				},
				error:function(data){
					console.log(data);
					console.log("保存失败");
				}
			})
        	}else{
        		location.reload();
        	}	
        }
        }
    })
	</script>
	<script type="text/javascript" src="${mainDomain}/statics/js/front/btsb/addsb.js" charset="UTF-8"></script>
</body>
</html>
